import { UpdatingComponent } from './page/update/updating.compoennt';
import { UpdateComponent } from './page/update/update.component';
import { PrinterComponent } from './page/device/printer/printer.component';
import { SearchLDCComponent } from './page/searchLDC/searchLDC.component';
import { InitComponent } from './page/init/init.component';
import { TableDetailComponent } from './page/tableDetail/tableDetail.component';
import { OrderComponent } from './page/order/order.component';
import { TableComponent } from './page/table/table.component';
import { AboutComponent } from './page/about/about.component';
import { ResetComponent } from './page/reset/reset.component';
import { SyncComponent } from './page/dataSync/sync.component';
import { EmployeeLoginComponent } from './page/employeeLogin/employeeLogin.component';
import { CheckEnvComponent } from './page/checkEnv/checkEnv.component';
import { BindDeviceComponent } from './page/bindDevice/bindDevice.component';
import { SetupComponent } from './page/setup/setup.component';
import { HomeComponent } from './page/home/home.component';
import { StoreComponent } from './page/selectStore/stores.component';
import { LoginComponent } from './page/storeLogin/login.component';
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { AddPrinterComponent } from "./page/device/printer/addPrinter/addPrinter.component";
import { PrinterDetailComponent } from "./page/device/printer/printerDetail/printerDetail.component";
import { SetPrinterComponent } from "./page/device/printer/setPrinter/setprinter.component";

export const ROUTES: Routes = [
    {
        path: "",
        pathMatch: "full",
        redirectTo: "init"
    },
    {
        path: "init",
        component: InitComponent
    },
    {
        path: "searchLDC/:searchMode",
        component: SearchLDCComponent
    },
    {
        path: 'storeLogin',
        component: LoginComponent
    },
    {
        path: 'selectStore',
        component: StoreComponent
    },
    {
        path: 'bindDevice',
        component: BindDeviceComponent
    },
    {
        path: 'checkEnv',
        component: CheckEnvComponent
    },
    {
        path: 'employeeLogin',
        component: EmployeeLoginComponent
    },
    {
        path: 'dataSync',
        component: SyncComponent
    },
    {
        path: 'home',
        component: HomeComponent
    },
    {
        path: 'setup',
        component: SetupComponent
    },
    {
        path: 'reset',
        component: ResetComponent
    },
    {
        path: 'about',
        component: AboutComponent
    },
    {
        path: 'table/:zoneId',
        component: TableComponent
    },
    {
        path: 'table/item/:id/:zoneId',
        component: TableDetailComponent
    },
    {
        path: 'order/:tableId/:zoneId',
        component: OrderComponent
    },
    {
        path: 'printer',
        component: PrinterComponent
    },
    {
        path: 'addPrinter',
        component: AddPrinterComponent
    },
    {
        path: 'printerDetail/:printerId',
        component: PrinterDetailComponent
    },
    {
        path: 'setPrinter',
        component: SetPrinterComponent
    },
    {
        path: "update",
        component: UpdateComponent
    },
    {
        path: '**',
        component: InitComponent
    }
];

@NgModule({
    imports: [RouterModule.forRoot(ROUTES, { useHash: true })],
    exports: [RouterModule]
})
export class AppRoutingModule { }